function Q_new = Q_ini_fun_OJS( Q_ini, param, aux)

    ln_m_ini = ln_m_KFE([param.m_l_ini, param.m_u_ini],1,aux)+log(1-param.shock);
    ln_m_new = ln_m_KFE([param.m_l, param.m_u],1,aux);
    
	Q_new=nan(size(ln_m_new));
        
    if  ln_m_ini(1)<log(param.m_l)
        ind = find(ln_m_ini>log(param.m_l),1);
        q = Q_ini(2:end)-Q_ini(1:end-1);
        layoff = q(1:ind)'./(1-param.alpha)*(log(param.m_l)-ln_m_ini(1:ind));
        Q_new(2:end) = min(max(interp1(ln_m_ini,Q_ini,ln_m_new(2:end),'pchip','extrap'),Q_ini(1)),Q_ini(end));
        if ln_m_ini(end)<log(param.m_u)
            Q_new(ln_m_new>ln_m_ini(end)) = Q_ini(end);
        end
        Q_new(end) = Q_ini(end);
        Q_new(1) = Q_ini(1)+layoff.*1/param.s;
        Q_new(2:end) = Q_new(2:end)+layoff.*(1/param.s-1);
        
    else
        Q_new=min(max(interp1(ln_m_ini,Q_ini,ln_m_new,'pchip','extrap'),Q_ini(1)),Q_ini(end));
        if ln_m_ini(end)<log(param.m_u)
            Q_new(ln_m_new>ln_m_ini(end)) = Q_ini(end);
        end
        if ln_m_ini(1)>log(param.m_l)
            Q_new(ln_m_new<=ln_m_ini(1)) = Q_ini(1);
        end        
    end    
end